package gearunits.models {
	import sandy.primitive.Primitive3D;
	import sandy.core.scenegraph.Geometry3D;
	import sandy.core.scenegraph.Shape3D;

	public class SMeshBuildingAirPort extends Shape3D implements Primitive3D {
		private var l:Geometry3D;

		private function f(v1:Number,v2:Number,v3:Number,uv00:Number,uv01:Number,uv10:Number,uv11:Number,uv20:Number,uv21:Number,normX:Number,normY:Number,normZ:Number):void {
			var uv1:Number = l.getNextUVCoordID();
			var uv2:Number = uv1 + 1;
			var uv3:Number = uv2 + 1;

			l.setUVCoords(uv1,uv00,1-uv01);
			l.setUVCoords(uv2,uv10,1-uv11);
			l.setUVCoords(uv3,uv20,1-uv21);

			l.setFaceVertexIds(l.getNextFaceID(), v1,v2,v3);
			l.setFaceUVCoordsIds(l.getNextFaceUVCoordID(), uv1,uv2,uv3);
			l.setFaceNormal(l.getNextFaceNormalID(), normX,normZ,normY);
		}

		private function f4(v1:Number,v2:Number,v3:Number,v4:Number,uv00:Number,uv01:Number,uv10:Number,uv11:Number,uv20:Number,uv21:Number,uv30:Number,uv31:Number,normX:Number,normY:Number,normZ:Number):void {
			var uv1:Number = l.getNextUVCoordID();
			var uv2:Number = uv1 + 1;
			var uv3:Number = uv2 + 1;
			var uv4:Number = uv3 + 1;

			l.setUVCoords(uv1,uv00,1-uv01);
			l.setUVCoords(uv2,uv10,1-uv11);
			l.setUVCoords(uv3,uv20,1-uv21);
			l.setUVCoords(uv4,uv30,1-uv31);

			l.setFaceVertexIds(l.getNextFaceID(),v1,v2,v3,v4);
			l.setFaceUVCoordsIds(l.getNextFaceUVCoordID(),uv1,uv2,uv3,uv4);
			l.setFaceNormal(l.getNextFaceNormalID(),normX,normZ,normY);
		}

		private function f2(v1:Number,v2:Number,v3:Number):void {
			l.setFaceVertexIds(l.getNextFaceID(), v1,v2,v3);
		}

		private function v(vx:Number,vy:Number,vz:Number):void {
			l.setVertex(l.getNextVertexID(),vx,vz,vy);
		}

		public function SMeshBuildingAirPort( p_Name:String=null ) {
			super( p_Name );
			geometry = generate();
		}

		public function generate(... arguments):Geometry3D {
			l = new Geometry3D();
			v(11.313708,11.313708,0.000000);
			v(14.782072,6.122935,0.000000);
			v(16.000000,-0.000001,0.000000);
			v(14.782072,-6.122936,0.000000);
			v(11.313708,-11.313708,0.000000);
			v(6.122936,-14.782072,0.000000);
			v(0.000002,-16.000000,0.000000);
			v(-6.122931,-14.782074,0.000000);
			v(-11.313705,-11.313712,0.000000);
			v(-14.782072,-6.122937,0.000000);
			v(-16.000000,0.000000,0.000000);
			v(-14.782071,6.122938,0.000000);
			v(-11.313704,11.313712,0.000000);
			v(-6.122928,14.782076,0.000000);
			v(0.000010,16.000000,0.000000);
			v(6.122947,14.782067,0.000000);
			v(11.313720,11.313698,2.000000);
			v(14.782080,6.122918,2.000000);
			v(16.000000,-0.000021,2.000000);
			v(14.782063,-6.122956,2.000000);
			v(11.313690,-11.313726,2.000000);
			v(6.122909,-14.782084,2.000000);
			v(-0.000031,-16.000000,2.000000);
			v(-6.122966,-14.782060,2.000000);
			v(-11.313734,-11.313683,2.000000);
			v(-14.782087,-6.122899,2.000000);
			v(-16.000000,0.000041,2.000000);
			v(-14.782056,6.122975,2.000000);
			v(-11.313676,11.313741,2.000000);
			v(-6.122890,14.782091,2.000000);
			v(0.000051,16.000000,2.000000);
			v(6.122985,14.782052,2.000000);
			v(0.000000,0.000000,0.000000);
			v(0.000000,0.000000,2.000000);

			f(32,0,1,0.750000,0.250000,1.000000,0.200272,1.000000,0.299728,-0.000000,0.000000,-1.000000);
			f(33,17,16,0.250000,0.250000,0.500000,0.200272,0.500000,0.299728,0.000000,0.000000,1.000000);
			f(32,1,2,0.750000,0.250000,1.000000,0.299728,0.961940,0.391614,-0.000000,0.000000,-1.000000);
			f(33,18,17,0.250000,0.250000,0.461940,0.108386,0.500000,0.200272,0.000000,0.000000,1.000000);
			f(32,2,3,0.750000,0.250000,0.961940,0.391614,0.891614,0.461940,0.000000,0.000000,-1.000000);
			f(33,19,18,0.250000,0.250000,0.391613,0.038060,0.461940,0.108386,0.000000,0.000000,1.000000);
			f(32,3,4,0.750000,0.250000,0.891614,0.461940,0.799728,0.500000,0.000000,0.000000,-1.000000);
			f(33,20,19,0.250000,0.250000,0.299728,0.000000,0.391613,0.038060,0.000000,0.000000,1.000000);
			f(32,4,5,0.750000,0.250000,0.799728,0.500000,0.700272,0.500000,0.000000,0.000000,-1.000000);
			f(33,21,20,0.250000,0.250000,0.200272,0.000000,0.299728,0.000000,0.000000,0.000000,1.000000);
			f(32,5,6,0.750000,0.250000,0.700272,0.500000,0.608386,0.461940,0.000000,0.000000,-1.000000);
			f(33,22,21,0.250000,0.250000,0.108386,0.038061,0.200272,0.000000,0.000000,-0.000000,1.000000);
			f(32,6,7,0.750000,0.250000,0.608386,0.461940,0.538060,0.391614,0.000000,0.000000,-1.000000);
			f(33,23,22,0.250000,0.250000,0.038060,0.108387,0.108386,0.038061,0.000000,-0.000000,1.000000);
			f(32,7,8,0.750000,0.250000,0.538060,0.391614,0.500000,0.299728,0.000000,0.000000,-1.000000);
			f(33,24,23,0.250000,0.250000,0.000000,0.200273,0.038060,0.108387,0.000000,-0.000000,1.000000);
			f(32,8,9,0.750000,0.250000,0.500000,0.299728,0.500000,0.200272,0.000000,0.000000,-1.000000);
			f(33,25,24,0.250000,0.250000,0.000000,0.299729,0.000000,0.200273,0.000000,-0.000000,1.000000);
			f(32,9,10,0.750000,0.250000,0.500000,0.200272,0.538060,0.108386,0.000000,0.000000,-1.000000);
			f(33,26,25,0.250000,0.250000,0.038061,0.391614,0.000000,0.299729,-0.000000,-0.000000,1.000000);
			f(32,10,11,0.750000,0.250000,0.538060,0.108386,0.608386,0.038060,0.000000,-0.000000,-1.000000);
			f(33,27,26,0.250000,0.250000,0.108387,0.461940,0.038061,0.391614,-0.000000,0.000000,1.000000);
			f(32,11,12,0.750000,0.250000,0.608386,0.038060,0.700272,0.000000,0.000000,-0.000000,-1.000000);
			f(33,28,27,0.250000,0.250000,0.200273,0.500000,0.108387,0.461940,-0.000000,0.000000,1.000000);
			f(32,12,13,0.750000,0.250000,0.700272,0.000000,0.799728,0.000000,0.000000,-0.000000,-1.000000);
			f(33,29,28,0.250000,0.250000,0.299729,0.500000,0.200273,0.500000,-0.000000,0.000000,1.000000);
			f(32,13,14,0.750000,0.250000,0.799728,0.000000,0.891614,0.038060,0.000000,-0.000000,-1.000000);
			f(33,30,29,0.250000,0.250000,0.391614,0.461939,0.299729,0.500000,-0.000000,0.000000,1.000000);
			f(32,14,15,0.750000,0.250000,0.891614,0.038060,0.961940,0.108387,-0.000000,0.000000,-1.000000);
			f(33,31,30,0.250000,0.250000,0.461940,0.391613,0.391614,0.461939,0.000000,0.000000,1.000000);
			f(15,0,32,0.961940,0.108387,1.000000,0.200272,0.750000,0.250000,0.000000,0.000000,-1.000000);
			f(33,16,31,0.250000,0.250000,0.500000,0.299728,0.461940,0.391613,0.000000,0.000000,1.000000);
			f(16,0,31,0.598187,0.570325,0.566325,0.570423,0.597971,0.500000,0.555572,0.831468,0.000001);
			f(0,15,31,0.566325,0.570423,0.566109,0.500097,0.597971,0.500000,0.555571,0.831469,-0.000004);
			f(14,30,15,0.534032,0.783323,0.565894,0.783226,0.534247,0.853649,0.195091,0.980785,-0.000004);
			f(30,31,15,0.565894,0.783226,0.566109,0.853552,0.534247,0.853649,0.195094,0.980785,0.000004);
			f(13,29,14,0.533750,0.691438,0.565612,0.691341,0.534032,0.783323,-0.195090,0.980785,-0.000004);
			f(29,30,14,0.565612,0.691341,0.565894,0.783226,0.534032,0.783323,-0.195087,0.980786,0.000004);
			f(12,28,13,0.533444,0.591982,0.565307,0.591885,0.533750,0.691438,-0.555570,0.831470,-0.000004);
			f(28,29,13,0.565307,0.591885,0.565612,0.691341,0.533750,0.691438,-0.555568,0.831471,0.000004);
			f(11,27,12,0.533163,0.500097,0.565025,0.500000,0.533444,0.591982,-0.831469,0.555570,-0.000004);
			f(27,28,12,0.565025,0.500000,0.565307,0.591885,0.533444,0.591982,-0.831468,0.555573,0.000004);
			f(10,26,11,0.599643,0.691438,0.631505,0.691341,0.599925,0.783323,-0.980785,0.195090,-0.000004);
			f(26,27,11,0.631505,0.691341,0.631787,0.783226,0.599925,0.783323,-0.980785,0.195093,0.000004);
			f(9,25,10,0.599338,0.591982,0.631200,0.591885,0.599643,0.691438,-0.980785,-0.195090,-0.000004);
			f(25,26,10,0.631200,0.591885,0.631505,0.691341,0.599643,0.691438,-0.980786,-0.195088,0.000004);
			f(8,24,9,0.599056,0.500097,0.630918,0.500000,0.599338,0.591982,-0.831469,-0.555570,-0.000004);
			f(24,25,9,0.630918,0.500000,0.631200,0.591885,0.599338,0.591982,-0.831471,-0.555568,0.000004);
			f(7,23,8,0.501085,0.853649,0.532947,0.853552,0.501300,0.923975,-0.555570,-0.831470,-0.000004);
			f(23,24,8,0.532947,0.853552,0.533163,0.923878,0.501300,0.923975,-0.555572,-0.831468,0.000004);
			f(6,22,7,0.500803,0.761764,0.532665,0.761667,0.501085,0.853649,-0.195090,-0.980785,-0.000003);
			f(22,23,7,0.532665,0.761667,0.532947,0.853552,0.501085,0.853649,-0.195092,-0.980785,0.000004);
			f(5,21,6,0.500498,0.662308,0.532360,0.662211,0.500803,0.761764,0.195090,-0.980785,-0.000003);
			f(21,22,6,0.532360,0.662211,0.532665,0.761667,0.500803,0.761764,0.195088,-0.980786,0.000003);
			f(4,20,5,0.500216,0.570423,0.532078,0.570326,0.500498,0.662308,0.555570,-0.831470,-0.000002);
			f(20,21,5,0.532078,0.570326,0.532360,0.662211,0.500498,0.662308,0.555569,-0.831470,0.000003);
			f(3,19,4,0.500000,0.500097,0.531862,0.500000,0.500216,0.570423,0.831470,-0.555570,-0.000002);
			f(19,20,4,0.531862,0.500000,0.532078,0.570326,0.500216,0.570423,0.831469,-0.555571,0.000002);
			f(2,18,3,0.566912,0.761764,0.598774,0.761666,0.567194,0.853649,0.980785,-0.195090,-0.000002);
			f(18,19,3,0.598774,0.761666,0.599056,0.853551,0.567194,0.853649,0.980785,-0.195092,0.000002);
			f(1,17,2,0.566607,0.662308,0.598469,0.662211,0.566912,0.761764,0.980785,0.195090,-0.000002);
			f(17,18,2,0.598469,0.662211,0.598774,0.761666,0.566912,0.761764,0.980785,0.195089,0.000002);
			f(0,16,1,0.566325,0.570423,0.598187,0.570325,0.566607,0.662308,0.831470,0.555570,-0.000002);
			f(16,17,1,0.598187,0.570325,0.598469,0.662211,0.566607,0.662308,0.831470,0.555569,0.000001);

			this.x = 0.000000;
			this.y = 0.000000;
			this.z = 0.000000;

			this.rotateX = 0.000000;
			this.rotateY = 0.000000;
			this.rotateZ = 0.000000;

			this.scaleX = 1.000000;
			this.scaleY = 1.000000;
			this.scaleZ = 1.000000;
			return (l);
		}
	}
}